package cn.net.yato.picture.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.*;

/**
 * @ClassName User
 * @Description 用户表
 * @Author yato
 * @Date 2020/2/17 12:41
 * @Version 1.0
 */
@Data
@TableName(value = "user")
public class User implements Serializable {
    /**
     * 自增id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private long id;
    /**
     *用户id 唯一
     */
    @TableField(value = "user_id")
    private String userId;
    /**
     * 用户名 唯一
     */
    @TableField(value = "username")
    private String userName;
    /**
     * 用户昵称
     */
    @TableField(value = "nickname")
    private String nickName;
    /**
     * 用户密码
     */
    @TableField(value = "password")
    private String passWord;
    /**
     * 盐值
     */
    @TableField(value = "salt")
    private String salt;
    /**
     * 用户邮箱
     */
    @TableField(value = "email")
    private String email;
    /**
     * 用户手机号码
     */
    @TableField(value = "phone")
    private String phone;
    /**
     * 微信Id
     */
    @TableField(value = "wecatId")
    private String wecatId;
    /**
     * 用户性别
     */
    @TableField(value = "sex")
    private char sex;
    /**
     * 用户年龄
     */
    @TableField(value = "age")
    private int age;
    /**
     * 用户地址
     */
    @TableField(value = "address")
    private String address;
    /**
     * 用户出生日期
     */
    @TableField(value = "birthday")
    private Date birthday;
    /**
     * 账户状态
     * 1:邮箱
     * 0:停用
     */
    @TableField(value = "status")
    private int status;
    /**
     * 账户创建日期
     */
    @TableField(value = "create_time")
    private Date createDate;
    /**
     * 账户修改日期
     */
    @TableField(value = "update_time")
    private Date updateDate;
    /**
     * 最后一次登录时间
     */
    @TableField(value = "last_login_time")
    private Date lastLoginDate;
    /**
     * 头像图片id
     */
    @TableField(value = "userHeadImgId")
    private String userHeadImgId;
    /**
     * 头像图片
     */
    @TableField(exist = false)
    private UserHeadImg userHeadImg;
    /**
     * 角色集合
     */
    @TableField(exist = false)
    private List<Role> roles = new ArrayList<>();
    /**
     * 权限集合
     */
    @TableField(exist = false)
    private List<Permission> permissions = new ArrayList<>();

    public User() {
    }

    public User(long id, String userId, String userName, String nickName, String passWord, String salt, String email, String phone, String wecatId, char sex, int age, String address, Date birthday, int status, Date createDate, Date updateDate, Date lastLoginDate, String userHeadImgId, UserHeadImg userHeadImg, List<Role> roles, List<Permission> permissions) {
        this.id = id;
        this.userId = userId;
        this.userName = userName;
        this.nickName = nickName;
        this.passWord = passWord;
        this.salt = salt;
        this.email = email;
        this.phone = phone;
        this.wecatId = wecatId;
        this.sex = sex;
        this.age = age;
        this.address = address;
        this.birthday = birthday;
        this.status = status;
        this.createDate = createDate;
        this.updateDate = updateDate;
        this.lastLoginDate = lastLoginDate;
        this.userHeadImgId = userHeadImgId;
        this.userHeadImg = userHeadImg;
        this.roles = roles;
        this.permissions = permissions;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    public String getUserHeadImgId() {
        return userHeadImgId;
    }

    public void setUserHeadImgId(String userHeadImgId) {
        this.userHeadImgId = userHeadImgId;
    }

    public UserHeadImg getUserHeadImg() {
        return userHeadImg;
    }

    public void setUserHeadImg(UserHeadImg userHeadImg) {
        this.userHeadImg = userHeadImg;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public List<Permission> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
    }

    public String getWecatId() {
        return wecatId;
    }

    public void setWecatId(String wecatId) {
        this.wecatId = wecatId;
    }
}
